//
//  UIBarButtonItem+Extension.swift
//  sinaWeibo
//
//  Created by 于 on 16/8/8.
//  Copyright © 2016年 于. All rights reserved.
//

import UIKit


extension UIBarButtonItem {


    convenience init(title: String, target: AnyObject?, action: Selector) {
        
        self.init()
        
        let btn = UIButton()
        
        btn.setTitle(title, forState: .Normal)
        
        btn.setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        btn.setTitleColor(UIColor.orangeColor(), forState: .Highlighted)
        btn.titleLabel?.font = UIFont.systemFontOfSize(14)
        btn.sizeToFit()
        
        btn.addTarget(target, action: action, forControlEvents: .TouchUpInside)
        
        
        customView = btn
        
    }



}